package com.ict.txmsv2.controller.dashboard;

import com.ict.txmsv2.model.MethodDescrition;
import com.ict.txmsv2.model.SumTime;
import com.ict.txmsv2.services.SumtimeService;
import com.ict.txmsv2.services.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author yoleen
 * @date 2020/12/16 11:52
 */

@RestController
@RequestMapping("/dashBoard")
public class DashBoardController {
    @Autowired
    SumtimeService sumtimeService;

    @Autowired
    UserService userService;

    @GetMapping("/sumtime/{cnt}")
    @MethodDescrition("获取一周打卡时间")
    public List<SumTime> getSumTimesForWeek(@PathVariable int cnt){
        return sumtimeService.getSumTimesForWeek(cnt);
    }

    @GetMapping("/personCount")
    public int personCount(){
        return userService.personCount();
    }
}
